home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-11
/
kgclock.zip
/
TEST.PRG
< prev
next >
Wrap
Text File
|
1992-08-13
|
4KB
|
112 lines
/*┌────────────────────────────────────────────────────────────────────────┐
│ Program Name: TEST.PRG Copyright: Gallagher Computing Corp. │▐
│ Date Created: 08/11/92 Language: Clipper 5.0 │▐
│ Time Created: 00:39:14 Author: Kevin S Gallagher .PRG │▐
│ c:/brief/clipper.src Author: Ben Echols .ASM │▐
│ │▐
│ If you like this function please send $5.00 (not required but helpful) │▐
│ Comments GOOD/BAD are always welcomed! │▐
└────────────────────────────────────────────────────────────────────────┘▐
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
*/
#include "grump.ch"
#define usercmd
#xcommand TRYCLOCK [ <var> ] ;
[ROW <nRow>] ;
[COL <nCol>] ;
=> ;
[<var> :=] MCLOCK( <nRow>, <nCol>)
function test
local x:=0, jj
GFSAVEENV(.T.,0,"W+/B")
dispbox(0,0,maxrow(),maxcol(),replicate(chr(177),9),"W+/B")
@0,0 say PADR(" ",80) color 'w+/gr'
EXBOX( 2, 4, 7, 54, 2, 20, , .T., "press any key to continue")
TRYCLOCK x ROW 0 COL 71 //── Install clock
@3,6 say "BK_TICKINS( <nRow>, <nCol> ) -->nErrorLevel"
@4,6 say "Installs the clock, using current screen colors"
@5,6 say "ErrorLevel can be used for error checking clock"
@6,6 say "nErrorlevel --> " + ltrim(str(x))
inkey(0)
TRYCLOCK ROW 99 COL 99 //── Uninstall clock
scroll(3,5,6,53)
@0,0 say PADR(" ",80) color 'w+/rb'
WAITON("The time is now ",.T.,"W+/GR",18)
TRYCLOCK ROW 19 COL 44 //── Reinstall clock
@3,6 say "The clock was moved with the following code"
@4,6 say " BK_TICKREM()"
@5,6 say "Both functions can be called in 1 line of code"
@6,6 say "As shown in the lower box.."
setcolor("W+/BG")
jj:=EXBOX( 12, 2, 14, 75, 2, 20, , .T., "press any key to continue")
@ 13,4 say "x := IF(nRow==NIL .OR. nCol==NIL,"+;
"BK_TICKREM(), BK_TICKINS(nRow, nCol))"
inkey(0)
BYEBYEBOX( jj )
inkey(1.1)
WAITOFF()
setcolor("W+/B")
TRYCLOCK ROW 99 COL 99 //── Uninstall clock
TRYCLOCK x ROW 0 COL 71 //── Reinstall clock
scroll(3,5,6,53)
@3,6 say "The clock was installed once again!"
@4,6 say "nErrorlevel --> " + ltrim(str(x))
@5,6 say "When ready press any key to Exit the demo"
inkey(0)
TRYCLOCK x ROW 99 COL 99 //── Uninstall clock
GFRESTENV()
do case
case x = 100
@0,0 say PADR(" Clock uninstalled OKAY",80) color "W+/B"
case x = 97
@0,0 say PADR(" ERROR clock returned 97",80) color "W+/B"
endcase
return nil
#ifdef Wimpy
function CLOCK(nRow,nCol)
local nErrLevel := 102
do case
case nRow = NIL .AND. nCol = NIL
nErrLevel:=BK_TICKREM() //── remove clock
case valtype(nRow) = "C" .OR. valtype(nCol) = "C"
return 102
case nRow >24
nErrLevel := 102
case nCol >72
nErrLevel := 102
case nCol>=0 .AND. nCol<=71 .AND. nRow>=0 .AND. nRow<=24
nErrLevel:=BK_TICKINS(nRow,nCol) //── install clock
endcase
if nErrLevel=97 .OR. nErrLevel = 102
alert(" FATAL ERROR ",{" REBOOT NOW "},"W+/B")
endif
return nErrLevel
#endif
#ifdef oneLiner
function EXPERTCLOCK(nRow,nCol)
local x:=IF(nRow==NIL.OR.nCol==NIL,BK_TICKREM(),BK_TICKINS(nRow, nCol))
return x
#endif
#ifdef usercmd
function MCLOCK(nRow,nCol)
local nErrLevel := 102
do case
case valtype(nRow) = "C" .OR. valtype(nCol) = "C"
return 101
case nRow = 99 .OR. nCol = 99
nErrLevel:= BK_TICKREM()
case nCol >= 0 .AND. nCol <= 71 .AND. nRow >= 0 .AND. nRow <= 24
nErrLevel := BK_TICKINS(nRow, nCol)
endcase
if nErrLevel=97 .OR. nErrLevel=1
alert(" FATAL ERROR ",{" REBOOT NOW "},"W+/B")
endif
return nErrLevel
#endif